package casino;

import java.awt.Container;
import java.awt.Cursor;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import javax.swing.JFrame;

public class Driver extends JFrame implements WindowListener{
	private static final long serialVersionUID = 1L; //serial version
	private Casino casino;
	
	public static void main(String[] args){
		new Driver();
	}
	
	public Driver(){
		super("Casino");
		pack();
		setResizable(true);
		
		pack();
		Container c = getContentPane();
		casino = new Casino();
		c.add(casino);
		pack();
		
		addWindowListener(this);
		setResizable(false);
		setVisible(true);
	}
	
	@Override
	public void windowActivated(WindowEvent e) {
		casino.resumeGame();
	}

	@Override
	public void windowClosed(WindowEvent e) {
		casino.quitGame();
	}

	@Override
	public void windowClosing(WindowEvent e) {
		casino.quitGame();
	}

	@Override
	public void windowDeactivated(WindowEvent e) {
		casino.pauseGame();
	}

	@Override
	public void windowDeiconified(WindowEvent e) {
		casino.resumeGame();
	}

	@Override
	public void windowIconified(WindowEvent e) {
		casino.pauseGame();
	}

	@Override
	public void windowOpened(WindowEvent e) {}
}
